package cn.cn.duotai3.java;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入第一个整数：");
        int num1 = sc.nextInt();
        System.out.print("请输入第二个整数：");
        int num2 = sc.nextInt();
        Calcolator calcolator = new Calcolator(num1,num2);

        System.out.println("请输入运算符(+,-,*,/)");
        char x = sc.next().charAt(0);
        switch (x) {
            case '+':
                calcolator=new add(num1,num2);
            ((add) calcolator).add();break;
            case '-':
                calcolator=new sub(num1,num2);
                ((sub) calcolator).sub();break;
            case '*':
                calcolator=new mul(num1,num2);
                ((mul) calcolator).mul();break;
            case '/':
                calcolator=new del(num1,num2);
                ((del) calcolator).del();break;

        }
    }
}